jQuery(function($){
$("#menuSearch .searchButton").on("click", function (){
$("#menuSearch .safir-searchform").stop().show().animate({ "width": "220px" }, 350);
$(".safir-searchform input[type=text]").focus();
if($("#menuSearch .safir-searchform").hasClass("visible")){
if($("#menuSearch input").val()==""){
$("#menuSearch .safir-searchform").animate({ "width": "0" }, 350, function (){
$("#menuSearch .safir-searchform").hide();
$("#menuSearch .safir-searchform").removeClass("visible");
});
}else{
$("#menuSearch .safir-searchform").trigger("submit");
}}
$("#menuSearch .safir-searchform").addClass("visible");
});
$(document).on("mouseup", function (e){
var container=$("#menuSearch .safir-searchform");
if(!container.is(e.target)&&container.has(e.target).length===0){
container.animate({ "width": "0" }, 350, function (){
container.hide();
container.removeClass("visible");
})
}});
localCity=localStorage.getItem("localCity");
if(localCity==null){
$(".weatherWidget .data").animate({ "opacity": "1" }, 150);
}else{
changeWeatherAjax(localCity, false);
}
$(".weatherWidget").on("click", ".topsection .city .name", function(){
$(this).closest(".weatherWidget").find(".cities").slideToggle();
});
$(".weatherWidget .cities span").on("click", function (){
changeWeatherAjax($(this).attr('data-city'));
$(this).closest(".cities").hide();
});
function changeWeatherAjax(city, ajaxrequest=true){
element=$(".weatherWidget");
if(ajaxrequest){
if(element.length){
element.find(".loading").fadeIn();
element.find(".options").hide();
element.find(".hamburger").fadeOut();
element.find(".data").animate({"opacity":"0"});
}}
nonce=$("body").attr("data-nonce");
$.ajax({
type: "post",
dataType: "json",
url: safirAjax.ajaxurl,
data: {
action: "safirAjaxRequest",
filename: "weatherajax",
city: city,
nonce: nonce,
},
success: function (response){
if(ajaxrequest){
element.find(".loading").fadeOut(function (){
element.find(".data").html(response.data).animate({"opacity":"1"}, 300);
});
}else{
$(".weatherWidget .data").html(response.data).animate({"opacity":"1"}, 300);
}
localStorage.setItem("localCity", city);
},
});
};
const owlNavText=[themeIcon("leftarrow"), themeIcon("rightarrow")];
$(".desktop #slider .owl-carousel").owlCarousel({
mouseDrag: false,
navText: owlNavText,
loop:true,
center:true,
autoplay:true,
autoWidth:true,
autoplayTimeout:6000,
autoplayHoverPause:true,
nav: true,
dots: false,
responsive:{
0:{
items: 1,
margin: 6,
},
600:{
items: 2,
margin: 6,
autoWidth: false,
},
800:{
items:3,
},
}});
$(".mobile #slider .owl-carousel").owlCarousel({
mouseDrag: false,
navText:owlNavText,
loop:true,
autoplay:true,
autoplayTimeout:6000,
autoplayHoverPause:true,
nav:true,
dots:false,
responsive:{
0:{
items:1,
},
600:{
items:2,
},
800:{
items:3,
},
}});
$(".sliderWidget .owl-carousel").owlCarousel({
mouseDrag: false,
loop:false,
navText:owlNavText,
autoplay:true,
autoplayTimeout:5000,
autoplayHoverPause:true,
rewind:true,
rewindNav:true,
dots: true,
lazyLoad: true,
responsive:{
0:{
items:1,
nav:true
},
},
onInitialized: makePages,
onResized: makePages,
});
$(".sliderWidget .owl-dot").hover(function(){
order=$(this).index();
$(this).closest(".sliderWidget").find(".owl-carousel").trigger("to.owl.carousel", [order, 500, true]);
});
function makePages(){
$(".sliderWidget").each(function(){
parentSlider=$(this);
counter=1;
$(this).find(".item").each(function(i){
if(counter==parentSlider.attr("data-adsorder")){
text="R";
parentSlider.find('.owl-dot').eq(counter-1).addClass("ads");
}else{
text=counter;
}
linkUrl=parentSlider.find('.item').eq(counter-1).find('a').attr('href');
if(linkUrl==null){
linkUrl="#";
}
parentSlider.find('.owl-dot').eq(counter - 1)
.html(`${text}`)
counter++;
});
});
}
$('.sliderWidget .owl-carousel .owl-dot a').click(function(){
window.location=$(this).attr("href");
});
function tabbedEvent($item){
parentTabbed=$item.closest(".tabbedWidget");
parentTabbed.find(".tab").stop().css('display', 'none');
parentTabbed.find(".tab").eq($item.parent().index()).stop().fadeIn(400);
parentTabbed.find(".tabheading a").removeClass("active");
parentTabbed.find('.tabheading a');
$item.addClass("active");
parentTabbed.find('.tabheading').attr("data-color", $item.data("color"));
parentTabbed.find(".tab").eq($item.parent().index()).find("img").unveil(0, function(){
$(this).load(function(){
this.style.opacity=1;
});
});
}
$(".tabbedWidget").each(function (){
$(this).find('.tab').first().fadeIn();
$(this).find('.tabheading a').first().addClass("active");
});
$(".desktop .tabbedWidget .tabheading a").hover(function (){
tabbedEvent($(this));
}, function(){});
$(".mobile .tabbedWidget .tabheading a").on("click", function (e){
if($(this).hasClass('active')==false){
if(e.preventDefault) e.preventDefault();
e.returnValue=false;
tabbedEvent($(this));
}});
$(".tabbedWidget .tabheading").owlCarousel({
mouseDrag: false,
loop: false,
dots: false,
nav: false,
navText: false,
autoplay: false,
autoWidth:true,
responsive:{
0:{
items:2,
nav:true
},
500:{
items:3,
nav:true
},
769:{
items:4,
nav:true
},
}});
$(".authorsWidget").each(function(){
parent=$(this);
order=parent.data("order");
if(parent.hasClass("nosort")) order="";
switch (order){
case 'rand':
parent.find(".scroll, .items").html(parent.find(".post-container").sort(function(){
return Math.random() - 0.5;
}));
break;
case 'lastpost':
case 'mostpost':
parent.find('.post-container').sort(function (a, b){
return $(b).attr('data-order') - $(a).attr('data-order');
}).appendTo(parent.find(".scroll, .items"));
break;
case 'manual':
parent.find('.post-container').sort(function (a, b){
return $(a).attr('data-order') - $(b).attr('data-order');
}).appendTo(parent.find(".scroll, .items"));
break;
}
parent.find(".items").css("opacity", "1");
parent.find(".scrollContainer").css("opacity", "1");
});
if($('.authorsWidget .scrollContainer .post-container').length > 3){
$('.authorsWidget .scrollContainer').css('height', '316px');
$('.authorsWidget .safir-nav').fadeIn();
var authorsInterval=setInterval(changeAuthors, 5e3);
}
authorsHeight=110;
function changeAuthors(){
$(".authorsWidget .scroll").stop().animate({
"margin-top": -1 * authorsHeight + "px"
}, 800, function (){
$(".authorsWidget .scroll").append($(".authorsWidget .scroll>.post-container:first-child"));
$(".authorsWidget .scroll").css("margin-top", 0)
});
$(".authorsWidget img.lazy").unveil(0, function(){
$(this).load(function(){
this.style.opacity=1;
});
});
}
$('.authorsWidget').hover(function (){
clearInterval(authorsInterval);
}, function (){
if($('.authorsWidget .scroll>.post-container').length > 3) authorsInterval=setInterval(changeAuthors, 5e3);
});
$(".authorsWidget .safir-nav div").on("click", function(){
if($(this).hasClass("up")){
$(".authorsWidget .scroll").stop().prepend($(".authorsWidget .scroll>.post-container:last-child"));
$(".authorsWidget .scroll").css("margin-top", -1 * authorsHeight + "px");
$(".authorsWidget .scroll").stop().animate({
"margin-top": "0"
}, 500)
}else{
$(".authorsWidget .scroll").stop().animate({
"margin-top": -1 * authorsHeight + "px"
}, 500, function (){
$(".authorsWidget .scroll").append($(".authorsWidget .scroll>.post-container:first-child"));
$(".authorsWidget .scroll").css("margin-top", 0);
})
}});
var galleryOwlOptionsHome={
onChanged: alterNavs, onInitialized: alterNavs, loop: false, navText: owlNavText, autoplay: true, autoplayTimeout: 6000, margin: 10, autoplayHoverPause: true, rewind: true, dots: false, nav: true, mouseDrag:false, responsive: {
0: { items: 1},
601: { items: 3},
769: { margin: 20},
}};
var galleryOwlOptionsSidebar={
onChanged: alterNavs, onInitialized: alterNavs, loop: false, navText: owlNavText, autoplay: true, autoplayTimeout: 6000, margin: 10, autoplayHoverPause: true, rewind: true, dots: false, nav: true, mouseDrag: false, responsive: {
0: { items: 1},
601: { items: 3},
769: { items: 1},
}};
var galleryOwlOptionsWide={
onChanged: alterNavs, onInitialized: alterNavs, loop: false, navText: owlNavText, autoplay: true, autoplayTimeout: 6000, margin: 10, autoplayHoverPause: true, rewind: true, dots: false, nav: true, mouseDrag: false, responsive: {
0: { items: 1},
601: { items: 3},
769: { items: 4, margin: 20},
}};
var mobileSingleColumn=$("body").attr("data-mobilesinglecolumn");
galleryOwlOptionsHome['responsive'][mobileSingleColumn]={'items': 2};
galleryOwlOptionsSidebar['responsive'][mobileSingleColumn]={'items': 2};
galleryOwlOptionsWide['responsive'][mobileSingleColumn]={'items': 2};
$(".sidebarWidget.galleryWidget .owl-carousel").each(function (){
$(this).owlCarousel(galleryOwlOptionsSidebar);
});
$(".homeWidget.galleryWidget .owl-carousel").each(function(){
$(this).owlCarousel(galleryOwlOptionsHome);
});
$(".wideWidget.galleryWidget .owl-carousel").each(function(){
$(this).owlCarousel(galleryOwlOptionsWide);
});
function alterNavs(){
$(".galleryWidget").each(function (){
parent=$(this).closest(".galleryWidget");
height=parent.find(".postthumb").height();
parent.find(".owl-nav button").css("top", (height / 2) + "px");
});
}
$(".galleryWidget[data-hovericon]").each(function(){
var icon=$(this).data("hovericon");
$(this).find(".postthumb a").append(`
${safirIcon(icon)}
`);
});
$("#toplogin .membershipButton").on("click", function(){
$("#loginMenu").not(".active").stop().slideDown(250).addClass("active");
});
$(document).on("mouseup", function (e){
var container=$("#loginMenu")
if(!container.is(e.target)&&container.has(e.target).length===0){
container.slideUp(250, function (){
container.removeClass("active")
});
}});
$(".wp-block-gallery figure a, div.gallery .gallery-item a").each(function (){
element=$(this);
href=element.attr("href");
if(href.substr(-4)==".jpg" ||
href.substr(-5)==".jpeg" ||
href.substr(-5)==".webp" ||
href.substr(-4)==".png" ||
href.substr(-4)==".gif"
){
element.append(themeIcon("fullscreen"));
}else{
element.append(themeIcon("link"));
}});
$(window).on("scroll", function (){
if($(this).scrollTop() > 150){
$('.safirTop').addClass("show");
}else{
$('.safirTop').removeClass("show");
}});
$('.safirTop').on("click", function (){
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
readingFontSize=localStorage.getItem("readingFontSize");
if(readingFontSize!=null){
$("").appendTo("body");
}
$('.metaBox .sizing').on("click", function(){
if($(this).hasClass('fontplus')){
currentSize=parseInt($('#singleContent, #single .excerpt').css('font-size')) + 1;
if(currentSize<=22){ $('#singleContent, #single .excerpt').css('font-size', currentSize); }}else if($(this).hasClass('fontminus')){
currentSize=parseInt($('#singleContent, #single .excerpt').css('font-size')) - 1;
if(currentSize>=11){ $('#singleContent, #single .excerpt').css('font-size', currentSize); }}
localStorage.setItem("readingFontSize", currentSize);
$("style#readingFontSize").html("#singleContent, #single .excerpt{font-size:"+currentSize+"px}");
});
$('#attachmentPage .skipAd').click(function(e){
e.preventDefault();
$('#attachmentPage .inner.ads').hide();
$('#galleryContent').fadeIn();
});
$("body").on("keydown", function(e){
var $url;
if(e.key=="ArrowLeft"){
$url=$('#gallery-nav').attr('data-prev');
}
else if(e.key=="ArrowRight"){
$url=$('#gallery-nav').attr('data-next');
}
if($url!=null){
window.location=$url;
}});
$('.safirHit').each(function(){
var id=$(this).data("id");
var multiple=$(this).data("multiple");
localVisits=localStorage.getItem("localVisits");
if(localVisits==null){
localVisits=[]
}else{
localVisits=JSON.parse(localVisits)
}
if(localVisits.includes(id)&&multiple==false){
$('.metaBox span.hit').animate({ "opacity": "1" }, 200)
return;
}
$.ajax({
type: "post",
dataType: "json",
url: safirAjax.ajaxurl,
data: {
action: "safirHits",
id: id,
nonce: $("body").attr("data-nonce"),
},
success: function (response){
if(localVisits.indexOf(id)===-1) localVisits.push(id)
localVisits=JSON.stringify(localVisits)
localStorage.setItem("localVisits", localVisits)
$('.metaBox span.hit').html(response.data).animate({"opacity":"1"}, 200)
},
error: function (xhr, ajaxOptions, thrownError){
console.log(xhr.responseText);
}});
});
$("#profile form button.submit").on("click", function (e){
e.preventDefault();
statusElement=$(this).closest("form").find("p.status");
statusElement.addClass("loading").html(statusElement.attr("data-loading"));
setTimeout(function (){
statusElement.closest("form").submit();
}, 100);
});
let fixedAdControlCount=0
function checkFixedSize(){
pageWidth=parseInt(getComputedStyle(document.documentElement).getPropertyValue('--safirWidth'));
width1=$('.fixedLeftAd').width()
width2=$('.fixedRightAd').width()
if(width1==0) width1=120
if(width2==0) width2=120
position1=($(window).width() - pageWidth) / 2 - width1
position2=($(window).width() - pageWidth) / 2 - width2
if(position1 >=0){
$('.fixedLeftAd').css('left', position1 + 'px').fadeIn()
}else{
$('.fixedLeftAd').css('left', position1 + 'px').fadeOut()
}
if(position2 >=0){
$('.fixedRightAd').css('right', position2 + 'px').fadeIn()
}else{
$('.fixedRightAd').css('right', position2 + 'px').fadeOut()
}
fixedAdControlCount++
if(fixedAdControlCount >=10) clearInterval(fixedAdInterval)
}
$(window).on("resize", ()=> {
checkFixedSize()
})
let fixedAdInterval=setInterval(checkFixedSize, 1000)
$('.mobileHeader .toggleMenu').click(function(){
if($(this).hasClass('open')){
$('.mobileHeader .toggleMenu').removeClass('open');
$("#hamburgermenu").stop().animate({"right": "-300px"},300);
$('#overlay').fadeOut();
$('body').css('overflow-y', 'visible');
}else{
$('.mobileHeader .toggleMenu').addClass('open');
$("#hamburgermenu").stop().animate({"right": "0"},300);
$('#overlay').fadeIn();
$('body').css('overflow-y', 'hidden');
}});
$('#overlay, #hamburgermenu span.close, #hamburgermenu .logoBlock a, #mobilemenu a').on("click", function(){
if(!$(this).parent().hasClass("menu-item-has-children")) closeHamburger();
});
function closeHamburger(){
$('.mobileHeader .toggleMenu').removeClass('open');
$("#safirPage").stop().animate({"left": "0"},300);
$('#overlay').fadeOut();
$("#hamburgermenu").stop().animate({"right": "-300px"},300, function(){
$('#mobilemenu').css('right', '0');
$('body').css('overflow-y', 'visible');
});
}
$('#mobilemenu li.menu-item-has-children').each(function (){
$(''+themeIcon("downarrow")+themeIcon("close")+'').appendTo($(this));
});
$("#mobilemenu .menu-item-has-children>a[href='#'], #mobilemenu .menu-item-has-children>span.mobilearrow").on("click", function (event){
event.preventDefault();
submenu=$(this).closest("li").find(">.sub-menu");
arrow=$(this).closest("li").find(">.mobilearrow");
submenu.slideToggle()
arrow.toggleClass("active");
});
$('.reading iframe, .reading object, .reading embed').wrap('')
$("a[rel^='external']").attr("target","_blank");
$('.sfrIconForm form .fileLabel+input[type=file]').on("change", function (){
fakeFile=$(this).val()
if(fakeFile==""){
$(this).prev().find('span.text').html($(this).prev().find('span.text').data("text"))
}else{
fakeFile=fakeFile.substring(fakeFile.lastIndexOf("\\") + 1, fakeFile.length)
$(this).prev().find('span.text').html(fakeFile)
}});
(function($){
$.fn.theiaStickySidebar=function (options){
var defaults={
'containerSelector': '',
'additionalMarginTop': 0,
'additionalMarginBottom': 0,
'updateSidebarHeight': true,
'minWidth': 0
};
options=$.extend(defaults, options);
options.additionalMarginTop=parseInt(options.additionalMarginTop)||0;
options.additionalMarginBottom=parseInt(options.additionalMarginBottom)||0;
$('head').append($(''));
this.each(function(){
var o={};
o.sidebar=$(this);
o.options=options||{};
o.container=$(o.options.containerSelector);
if(o.container.length==0){
o.container=o.sidebar.parent();
}
o.sidebar.parents().css('-webkit-transform', 'none');
o.sidebar.css({
'position': 'relative',
'overflow': 'visible',
'-webkit-box-sizing': 'border-box',
'-moz-box-sizing': 'border-box',
'box-sizing': 'border-box'
});
o.stickySidebar=o.sidebar.find('.theiaStickySidebar');
if(o.stickySidebar.length==0){
o.sidebar.find('script').remove();
o.stickySidebar=$('').addClass('theiaStickySidebar').append(o.sidebar.children());
o.sidebar.append(o.stickySidebar);
}
o.marginTop=parseInt(o.sidebar.css('margin-top'));
o.marginBottom=parseInt(o.sidebar.css('margin-bottom'));
o.paddingTop=parseInt(o.sidebar.css('padding-top'));
o.paddingBottom=parseInt(o.sidebar.css('padding-bottom'));
var collapsedTopHeight=o.stickySidebar.offset().top;
var collapsedBottomHeight=o.stickySidebar.outerHeight();
o.stickySidebar.css('padding-top', 0);
o.stickySidebar.css('padding-bottom', 0);
collapsedTopHeight -=o.stickySidebar.offset().top;
collapsedBottomHeight=o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight;
if(collapsedTopHeight==0){
o.stickySidebar.css('padding-top', 0);
o.stickySidebarPaddingTop=0;
}else{
o.stickySidebarPaddingTop=0;
}
if(collapsedBottomHeight==0){
o.stickySidebar.css('padding-bottom', 0);
o.stickySidebarPaddingBottom=0;
}else{
o.stickySidebarPaddingBottom=0;
}
o.previousScrollTop=null;
o.fixedScrollTop=0;
resetSidebar();
o.onScroll=function(o){
if(!o.stickySidebar.is(":visible")){
return;
}
if($('body').width() < o.options.minWidth){
resetSidebar();
return;
}
if(o.sidebar.outerWidth(true) + 50 > o.container.width()){
resetSidebar();
return;
}
var scrollTop=$(document).scrollTop();
var position='static';
if(scrollTop >=o.container.offset().top + (o.paddingTop + o.marginTop - o.options.additionalMarginTop)){
var offsetTop=o.paddingTop + o.marginTop + options.additionalMarginTop;
var offsetBottom=o.paddingBottom + o.marginBottom + options.additionalMarginBottom;
var containerTop=o.container.offset().top;
var containerBottom=o.container.offset().top + getClearedHeight(o.container);
var windowOffsetTop=0 + options.additionalMarginTop;
var windowOffsetBottom;
var sidebarSmallerThanWindow=(o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height();
if(sidebarSmallerThanWindow){
windowOffsetBottom=windowOffsetTop + o.stickySidebar.outerHeight();
}else{
windowOffsetBottom=$(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom;
}
var staticLimitTop=containerTop - scrollTop + o.paddingTop + o.marginTop;
var staticLimitBottom=containerBottom - scrollTop - o.paddingBottom - o.marginBottom;
var top=o.stickySidebar.offset().top - scrollTop;
var scrollTopDiff=o.previousScrollTop - scrollTop;
if(o.stickySidebar.css('position')=='fixed'){
top +=scrollTopDiff;
}
if(scrollTopDiff > 0){
top=Math.min(top, windowOffsetTop);
}else{
top=Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight());
}
top=Math.max(top, staticLimitTop);
top=Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight());
var sidebarSameHeightAsContainer=o.container.height()==o.stickySidebar.outerHeight();
if(!sidebarSameHeightAsContainer&&top==windowOffsetTop){
position='fixed';
}
else if(!sidebarSameHeightAsContainer&&top==windowOffsetBottom - o.stickySidebar.outerHeight()){
position='fixed';
}
else if(scrollTop + top - o.sidebar.offset().top - o.paddingTop <=options.additionalMarginTop){
position='static';
}else{
position='absolute';
}}
if(position=='fixed'){
o.stickySidebar.css({
'position': 'fixed',
'width': o.sidebar.width(),
'top': top,
'left': o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left'))
});
}
else if(position=='absolute'){
var css={};
if(o.stickySidebar.css('position')!='absolute'){
css.position='absolute';
css.top=scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom;
}
css.width=o.sidebar.width();
css.left='';
o.stickySidebar.css(css);
}
else if(position=='static'){
resetSidebar();
}
if(position!='static'){
if(o.options.updateSidebarHeight==true){
o.sidebar.css({
'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom
});
}}
o.previousScrollTop=scrollTop;
};
o.onScroll(o);
$(document).scroll(function(o){
return function(){
o.onScroll(o);
};}(o));
$(window).resize(function(o){
return function(){
o.stickySidebar.css({'position': 'static'});
o.onScroll(o);
};}(o));
function resetSidebar(){
o.fixedScrollTop=0;
o.sidebar.css({
'min-height': '1px'
});
o.stickySidebar.css({
'position': 'static',
'width': ''
});
}
function getClearedHeight(e){
var height=e.height();
e.children().each(function(){
height=Math.max(height, $(this).height());
});
return height;
}});
}})(jQuery);
$('.stickySidebar aside, .stickySidebar .homeWidgetContainer .rightContainer').theiaStickySidebar();
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){var b=Array.prototype.slice,c=Array.prototype.splice,d={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",widthFromWrapper:!0,responsiveWidth:!1,zIndex:"auto"},e=a(window),f=a(document),g=[],h=e.height(),i=function(){for(var b=e.scrollTop(),c=f.height(),d=c-h,i=b>d?d-b:0,j=0,k=g.length;k>j;j++){var l=g[j],m=l.stickyWrapper.offset().top,n=m-l.topSpacing-i;if(l.stickyWrapper.css("height",l.stickyElement.outerHeight()),n>=b)null!==l.currentTop&&(l.stickyElement.css({width:"",position:"",top:"","z-index":""}),l.stickyElement.parent().removeClass(l.className),l.stickyElement.trigger("sticky-end",[l]),l.currentTop=null);else{var o=c-l.stickyElement.outerHeight()-l.topSpacing-l.bottomSpacing-b-i;if(0>o?o+=l.topSpacing:o=l.topSpacing,l.currentTop!==o){var p;l.getWidthFrom?p=a(l.getWidthFrom).width()||null:l.widthFromWrapper&&(p=l.stickyWrapper.width()),null==p&&(p=l.stickyElement.width()),l.stickyElement.css("width",p).css("position","fixed").css("top",o).css("z-index",l.zIndex),l.stickyElement.parent().addClass(l.className),null===l.currentTop?l.stickyElement.trigger("sticky-start",[l]):l.stickyElement.trigger("sticky-update",[l]),l.currentTop===l.topSpacing&&l.currentTop>o||null===l.currentTop&&o
=q.offset().top+q.outerHeight()&&l.stickyElement.offset().top<=l.topSpacing;r?l.stickyElement.css("position","absolute").css("top","").css("bottom",0).css("z-index",""):l.stickyElement.css("position","fixed").css("top",o).css("bottom","").css("z-index",l.zIndex)}}},j=function(){h=e.height();for(var b=0,c=g.length;c>b;b++){var d=g[b],f=null;d.getWidthFrom?d.responsiveWidth&&(f=a(d.getWidthFrom).width()):d.widthFromWrapper&&(f=d.stickyWrapper.width()),null!=f&&d.stickyElement.css("width",f)}},k={init:function(b){var c=a.extend({},d,b);return this.each(function(){var b=a(this),e=b.attr("id"),f=e?e+"-"+d.wrapperClassName:d.wrapperClassName,h=a("").attr("id",f).addClass(c.wrapperClassName);b.wrapAll(function(){return 0==a(this).parent("#"+f).length?h:void 0});var i=b.parent();c.center&&i.css({width:b.outerWidth(),marginLeft:"auto",marginRight:"auto"}),"right"===b.css("float")&&b.css({"float":"none"}).parent().css({"float":"right"}),c.stickyElement=b,c.stickyWrapper=i,c.currentTop=null,g.push(c),k.setWrapperHeight(this),k.setupChangeListeners(this)})},setWrapperHeight:function(b){var c=a(b),d=c.parent();d&&d.css("height",c.outerHeight())},setupChangeListeners:function(a){if(window.MutationObserver){var b=new window.MutationObserver(function(b){(b[0].addedNodes.length||b[0].removedNodes.length)&&k.setWrapperHeight(a)});b.observe(a,{subtree:!0,childList:!0})}else a.addEventListener("DOMNodeInserted",function(){k.setWrapperHeight(a)},!1),a.addEventListener("DOMNodeRemoved",function(){k.setWrapperHeight(a)},!1)},update:i,unstick:function(b){return this.each(function(){for(var b=this,d=a(b),e=-1,f=g.length;f-->0;)g[f].stickyElement.get(0)===b&&(c.call(g,f,1),e=f);-1!==e&&(d.unwrap(),d.css({width:"",position:"",top:"","float":"","z-index":""}))})}};window.addEventListener?(window.addEventListener("scroll",i,!1),window.addEventListener("resize",j,!1)):window.attachEvent&&(window.attachEvent("onscroll",i),window.attachEvent("onresize",j)),a.fn.sticky=function(c){return k[c]?k[c].apply(this,b.call(arguments,1)):"object"!=typeof c&&c?void a.error("Method "+c+" does not exist on jQuery.sticky"):k.init.apply(this,arguments)},a.fn.unstick=function(c){return k[c]?k[c].apply(this,b.call(arguments,1)):"object"!=typeof c&&c?void a.error("Method "+c+" does not exist on jQuery.sticky"):k.unstick.apply(this,arguments)},a(function(){setTimeout(i,0)})});
topMargin=0
if($("body.desktop").hasClass("admin-bar")){
topMargin=32;
}
if($("body.mobile").hasClass("admin-bar")){
topMargin=0;
}
$('.stickyMenu #header-cont').sticky({topSpacing:topMargin, zIndex: 9990});
!function(t){t.fn.unveil=function(i,e){var n,r=t(window),o=i||0,u=window.devicePixelRatio>1?"data-src-retina":"data-src",s=this;function l(){var i=s.filter(function(){var i=t(this);if(!i.is(":hidden")){var e=r.scrollTop(),n=e+r.height(),u=i.offset().top;return u+i.height()>=e-o&&u<=n+o}});n=i.trigger("unveil"),s=s.not(n)}return this.one("unveil",function(){var t=this.getAttribute(u);(t=t||this.getAttribute("data-src"))&&(this.setAttribute("src",t),"function"==typeof e&&e.call(this))}),r.on("scroll.unveil resize.unveil lookup.unveil",l),l(),this}}(window.jQuery||window.Zepto);
$('img.lazy').unveil(0, function(){
$(this).load(function(){
this.style.opacity=1;
});
});
function themeIcon(icon){
return '';
}
function safirIcon(icon){
return ``;
}
$(".commentlist .comment-meta a:first-child").prepend(themeIcon("calendar"));
$("#comments a.comment-reply-link").prepend(themeIcon("reply2"));
$("#comments ol.children li .comment-body").prepend(themeIcon("reply1"));
$(" - ").insertBefore(".safirCategoryMeta a:not(first-child)");
});